<?php
namespace src\logic;
class lfbgraph {
	const API_HOST = 'graph.facebook.com';
	/**
	 * 更新地址资料信息
	 * @param string $url
	 */
	public static function clear($url) {
		$sock = fsockopen('ssl://'.self::API_HOST, 443, $errno, $errstr, 15);
		if (!$sock) {
			return;
		}
		$qrystr= sprintf('id=%s&scrape=true', urlencode($url));
		$data  = "POST / HTTP/1.1\r\nAccept: */*\r\nAccept-Language: zh-cn,en-us;q=0.5\r\n";
		$data .= "Content-Type: application/x-www-form-urlencoded\r\nUser-Agent: Mozilla/4.0 ";
		$data .= "(compatible; MSIE 5.0; Windows NT; .NET CLR 1.0.3705; .NET CLR 1.1.4322)\r\n";
		$data .= "Host: graph.facebook.com\r\nContent-Length: ".strlen($qrystr)."\r\nPragma: no-cache\r\n\r\n".$qrystr;
		fwrite($sock, $data);
		fclose($sock);
	}
}